/**
  * Copyright 2017 JessYan
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
package com.ewzj.bigdata.mvp.model.api.service;

import com.ewzj.bigdata.mvp.model.api.Api;
import com.ewzj.bigdata.mvp.model.entity.resbean.ArticleBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.BannerBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.BaseData;
import com.ewzj.bigdata.mvp.model.entity.resbean.BaseJson;
import com.ewzj.bigdata.mvp.model.entity.resbean.BaseListData;
import com.ewzj.bigdata.mvp.model.entity.resbean.CollectBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.CommentBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.FilterBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.NewBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.ResCollectSuccess;
import com.ewzj.bigdata.mvp.model.entity.resbean.ResCommentBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.ResIdBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.SearchResultBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.TabBean;
import com.ewzj.bigdata.mvp.model.entity.resbean.UserBean;
import com.jess.arms.base.App;


import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * ================================================
 * 存放通用的一些 API
 * <p>
 * Created by JessYan on 08/05/2016 12:05
 * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
 * <a href="https://github.com/JessYanCoding">Follow me</a>
 * ================================================
 */
public interface CommonService {
    @POST(Api.NEWS_LIST)
    Observable<BaseData<BaseListData<NewBean>>> getNews(@Body  RequestBody requestBody);
    @POST(Api.TAB_LIST)
    Observable<BaseData<List<TabBean>>> getTabs();
    @POST(Api.FILTER_LIST)
    Observable<BaseData<List<FilterBean>>> getFilters(@Body RequestBody requestBody);
    @POST(Api.BANNER_LIST)
    Observable<BaseData<List<BannerBean>>> getBanners(@Body RequestBody requestBody);
    @POST(Api.COLLECT_LIST)
    Observable<BaseData<BaseListData<CollectBean>>> getCollects(@Body RequestBody requestBody);
    @POST(Api.COLLECT_UPDATE)
    Observable<BaseData<CollectBean>> updateCollect(@Body RequestBody requestBody);
    @POST(Api.COLLECT_DEL)
    Observable<BaseData<CollectBean>> delCollect(@Body RequestBody requestBody);
    @POST(Api.COLLECT_CREAT)
    Observable<BaseData<CollectBean>> createCollect(@Body RequestBody requestBody);
    @POST(Api.COLLECT_CHILD_LIST)
    Observable<BaseData<BaseListData<NewBean>>> getCollectChilds(@Body RequestBody requestBody);
    @POST(Api.ARTICLE_DETAIL)
    Observable<BaseData<ArticleBean>> getArticleDetail(@Body RequestBody requestBody);
    @POST(Api.GUESS_LIKE)
    Observable<BaseData<List<NewBean>>> guessLikeList(@Body RequestBody requestBody);
    @POST(Api.COMMENT_LIST)
    Observable<BaseData<BaseListData<CommentBean>>> commentList(@Body RequestBody requestBody);
    @POST(Api.COMMENT_ADD)
    Observable<BaseData<ResCommentBean>> commentAdd(@Body RequestBody requestBody);
    @POST(Api.SMS_SEND)
    Observable<BaseData<String>> sendSms(@Body RequestBody requestBody);
    @POST(Api.USER_REGISTER)
    Observable<BaseData<String>> registerUser(@Body RequestBody requestBody);
    @POST(Api.USER_LOGIN)
    Observable<BaseData<UserBean>> userLogin(@Body RequestBody requestBody);
    @POST(Api.USER_INFO)
    Observable<BaseData<UserBean>> loadUserInfo();
    @POST(Api.DO_COLLECT)
    Observable<BaseData<ResCollectSuccess>> doCollect(@Body RequestBody requestBody);
    @POST(Api.COMMENT_REPLY)
    Observable<BaseData<ResCommentBean>> commentReply(@Body RequestBody requestBody);
    @POST(Api.COMMENT_PRAISE)
    Observable<BaseData<ResIdBean>> commentPraise(@Body RequestBody requestBody);
    @POST(Api.USER_FEEDBACK)
    @Multipart
    Observable<BaseData<String>> userFeedBack(@Part() List<MultipartBody.Part> parts);
    @POST(Api.UPDATE_USERINFO)
    @Multipart
    Observable<BaseData<String>> userUpdateInfo(@Query("nickname") String nickname
            ,@Query("email") String email
            ,@Query("gender") String gender
            ,@PartMap() Map<String, RequestBody> maps);
    @POST
    Observable<BaseJson> getDataFromService(@Url String url, @Body RequestBody requestBody);
    @POST
    Observable<BaseJson> getDataFromServiceNobody(@Url String url);

    @POST(Api.SEARCH_HOT)
    Observable<BaseData<List<SearchResultBean>>> getHotSearch();

    @POST(Api.SEARCH_LIST)
    Observable<BaseData<BaseListData<NewBean>>> getSearchList(@Body RequestBody requestBody);
}
